class PostReqByTag extends PostsReq{

  String _tags;

  PostReqByTag(Blog blog, String url, String tags):super(blog,url){
	_tags = tags;
  }

	void loadNextPage(Queue nextPage){
	  String lastID = _blog.getLastID();
      if(lastID == null){
		window.alert("ERROR in loadNextPage: lastID == null");
     	  return;
	  }
		String params = "?getpostsbytag=true&id=$lastID";
		getPostsFromServer("POST", params, JSON.stringify(_tags), nextPage);
	}
	
	void loadPrevPage(Queue prevPage){
	  String firstID = _blog.getFirstID();
      if(firstID == null){
		  window.alert("ERROR in loadPrevPage: firstID == null");
     	  return;
	  }
		String params = "?getpostsbytag=true&prev=true&id=$firstID";
		getPostsFromServer("POST", params, JSON.stringify(_tags), prevPage);
	}
	
	void loadCurrPage(Queue currPage){
		String params = "?getpostsbytag=true";
		getPostsFromServer("POST", params, JSON.stringify(_tags), currPage);
	}
  
}
